﻿cmake_minimum_required (VERSION 2.8)

project(QtGlog)

LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

set(CMAKE_BUILD_TYPE "Release")
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -Wall -Wno-unused-variable -pthread")
else( CMAKE_BUILD_TYPE STREQUAL "Debug" )
        set(CMAKE_BUILD_TYPE "Release")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -pthread -fopenmp")
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )

message("Build Type:" ${CMAKE_BUILD_TYPE} ${CMAKE_CXX_FLAGS})

##################################################
# Qt5
##################################################
# Find the QtWidgets library  
find_package(Qt5Widgets)
find_package(Qt5Core)
include_directories(${QT_USE_FILE})

##################################################
# Glog
##################################################
FIND_PACKAGE(Glog REQUIRED QUIET)
INCLUDE_DIRECTORIES(BEFORE ${GLOG_INCLUDE_DIRS})


set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_AUTOMOC ON) 
aux_source_directory(${PROJECT_SOURCE_DIR}/src SOURECE_SRC)

add_executable(QtGlog ${SOURECE_SRC})
target_link_libraries(QtGlog ${Qt5Widgets_LIBRARIES} ${Qt5Core_LIBRARIES} ${GLOG_LIBRARIES})
